<?php

header('Access-Control-Allow-Origin:*');
// 响应类型
header('Access-Control-Allow-Methods:POST,GET,PUT,DELETE');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with,Content-Type,X-CSRF-Token');
$mysqli = new Mysqli("localhost", "root", "root", "db_yuedu");
if ($mysqli->connect_errno) {
    die();
}
$username = $_POST["username"];
$sql = "select  username,password from t_users where username = '{$username}'";
$result = $mysqli->query($sql);
$row = $result->fetch_assoc();
$json = json_encode($row);
print_r($json);


       